import hyRequest from "@/service/index"

import type { IDataType } from "../../types"

export function getPageList(pageUrl: string, queryInfo?: any) {
  return hyRequest.post<IDataType>({
    url: pageUrl,
    data: queryInfo
  })
}

export function deletePageDateById(pageUrl: string) {
  return hyRequest.delete<IDataType>({
    url: pageUrl
  })
}

// 新建
export function newPageData(pageUrl: string, newData: any) {
  return hyRequest.post<IDataType>({
    url: pageUrl,
    data: newData
  })
}

// 编辑
export function editPageData(pageUrl: string, editData: any,) {
  return hyRequest.patch<IDataType>({
    url: pageUrl,
    data: editData
  })
}